<!DOCTYPE html>
<html lang="en">
<head>

    <!--
      Obviously, used Bootstrap Web site as template.
      Tried to write from scratch but it still looked like bootstrap site, but wasn't that good.
    -->

    <meta charset="utf-8">
    <title>Midao Project</title>
    <meta property="og:title" content="Midao - data oriented umbrella project"/>
    <meta property="og:description"
          content="Midao Project is created to shield Java developer from nuances of vendor implementation and standard boilerplate code.
            Midao JDBC simplifies development with Java JDBC. It is flexible, customizable, and simple/intuitive to use, and provides a lot of functionality"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/bootstrap-responsive.css" rel="stylesheet">
    <link href="css/docs.css" rel="stylesheet">
    <link href="js/google-code-prettify/prettify.css" rel="stylesheet">

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png">
    <link rel="shortcut icon" href="ico/favicon.png">

</head>

<body data-spy="scroll" data-target=".bs-docs-sidebar">

<!-- Navbar
================================================== -->
<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>

            <div class="nav-collapse collapse">
                <ul class="nav pull-left">
                    <li class="dropdown">
                        <a href="" class="brand" data-toggle="dropdown">Midao Project <i class="icon-chevron-down icon-white caret-chevron-c"></i></a>
                        <ul class="dropdown-menu pull-right">
                            <li class="">
                                <a href="./home.html">Home</a>
                            </li>
                            <li class="">
                                <a href="./news">Blog / news</a>
                            </li>
                            <li class="">
                                <a href="./status.html">Status / future</a>
                            </li>
                            <li class="">
                                <a href="./get-involved.html">Get Involved</a>
                            </li>
                        </ul>
                    </li>

                    <li class="dropdown">
                        <a href="" class="dropdown-toggle brand" data-toggle="dropdown">Midao JDBC <i class="icon-chevron-down icon-white caret-chevron-c"></i></a>
                        <ul class="dropdown-menu pull-right">
                            <li class="">
                                <a href="./mjdbc-query.html">Query Execution</a>
                            </li>
                            <li class="">
                                <a href="./mjdbc-io-handlers.html">IO Handlers</a>
                            </li>
                            <li class="">
                                <a href="./mjdbc-core-handlers.html">Core Handlers</a>
                            </li>
                            <li class="">
                                <a href="./mjdbc-other-features.html">Other features</a>
                            </li>
                        </ul>
                    </li>
                </ul>

                <ul class="nav pull-right">
                    <li>
                        <a class="brand">Midao JDBC Tutorials <i class="icon-chevron-right icon-white caret-chevron-c"></i></a>
                    </li>

                    <li class="">
                        <a href="./mjdbc-presentation.html">Presentation</a>
                    </li>
                    <li class="active">
                        <a href="./mjdbc-getting-started.html">Getting started</a>
                    </li>
                    <ul>

            </div>
        </div>
    </div>
</div>

<!-- Subhead
================================================== -->
<header class="jumbotron subhead" id="overview">
    <div class="container">
        <h1>Getting started</h1>

        <p class="lead">Midao JDBC Tutorial to help start using library</p>
    </div>
</header>

<div class="container">

    <!-- Docs nav
    ================================================== -->
    <div class="row">
        <div class="span3 bs-docs-sidebar">
            <ul class="nav nav-list bs-docs-sidenav">
                <li><a href="#before-start"><i class="icon-chevron-right"></i> Before we start</a></li>
                <li><a href="#start-using"><i class="icon-chevron-right"></i> Start using</a></li>
                <li><a href="#directions"><i class="icon-chevron-right"></i> Directions</a></li>
                <li><a href="#query-runner"><i class="icon-chevron-right"></i> |--- Query runner</a></li>
                <li><a href="#io-handlers"><i class="icon-chevron-right"></i> |--- Input/Output handlers</a></li>
                <li><a href="#type-handlers"><i class="icon-chevron-right"></i> |--- Type handlers</a></li>
                <li><a href="#other-features"><i class="icon-chevron-right"></i> |--- Other features</a></li>
                <li><a href="#examples"><i class="icon-chevron-right"></i> Examples</a></li>
                <li><a href="#simple-example"><i class="icon-chevron-right"></i> |--- Simple example</a></li>
                <li><a href="#list-example"><i class="icon-chevron-right"></i> |--- List example</a></li>
                <li><a href="#lob-example"><i class="icon-chevron-right"></i> |--- Lob types example</a></li>
            </ul>
        </div>
        <div class="span9">

            <!-- Before we start
            ================================================== -->
            <section id="before-start">
                <div class="page-header">
                    <h1>1. Before we start</h1>
                </div>

                <p class="lead">If you never worked with Java JDBC I am highly recommending to review <a href="http://docs.oracle.com/javase/tutorial/jdbc/">Oracle JDBC Official tutorial</a></p>

                <p class="lead">If you haven't seen Midao JDBC Presentation - <a href="mjdbc/MJDBC_Presentation.pdf">please look at it</a> as it is complimentary to this tutorial.</p>

                <p>It is expected that you have SQL Connection received or from <a href="http://docs.oracle.com/javase/tutorial/jdbc/basics/sqldatasources.html#datasource_connection">DataSource</a> or from
                    <a href="http://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html#drivermanager">DriverManager</a>.</p>
            </section>

            <!-- Start using
            ================================================== -->
            <section id="start-using">
                <div class="page-header">
                    <h1>2. Start using</h1>
                </div>

                <p class="lead">Midao JDBC can be received as jar from: <a href="http://midao.org/home.html#start-using">Midao web site</a>, <a href="https://github.com/pryzach/midao/releases">GitHub</a> or just by adding Maven dependency:</p>
						<pre class="linenums">
pom.xml:

..
&ltdependency&gt
  &ltgroupId&gtorg.midao&lt/groupId&gt
  &ltartifactId&gtmidao-jdbc-core&lt/artifactId&gt
  &ltversion&gt0.9.4&lt/version&gt
&lt/dependency&gt
..</pre>
            </section>

            <!-- Directions
            ================================================== -->
            <section id="directions">
                <div class="page-header">
                    <h1>3. Directions</h1>
                </div>

                <p class="lead">List of components important to get to know at the beginning:</p>
                <ul>
                    <li>
                        <div class="well well-small well-no-margin-c">Query Runner</div>
                        <ul>
                            <code>Is core class of the library. Provides ability to execute query.</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">Input Handlers</div>
                        <ul>
                            <code>Input handlers are responsible for handling input: such as (named) SQL query and input parameter values.</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">Output Handlers</div>
                        <ul>
                            <code>Output handlers are responsible for handling/conversion query output (ResultSets).</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">Type Handlers</div>
                        <ul>
                            <code>Type handlers are responsible for handling types (automatically converts String into CLOB and back etc.)</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">Profiling</div>
                        <ul>
                            <code>Profiling allows... to perform Query profiling...</code>
                        </ul>
                    </li>
                </ul>

                <p class="lead">List of components useful during advanced usage of the library:</p>
                <ul>
                    <li>
                        <div class="well well-small well-no-margin-c">Pooled data sources</div>
                        <ul>
                            <code>Pooled data sources provides ability to create Connection pools.</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">Lazy output handlers</div>
                        <ul>
                            <code>Unlike standard cached queries (default) - lazy output handlers reads only data you need and when you need it.</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">Midao config</div>
                        <ul>
                            <code>Allows configuring default behaviour of Midao JDBC library.</code>
                        </ul>
                    </li>
                </ul>

                <p class="lead">List of components useful to know when you plan to extend library:</p>
                <ul>
                    <li>
                        <div class="well well-small well-no-margin-c">Statement handlers</div>
                        <ul>
                            <code>Statement handlers are responsible for handling JDBC Statements</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">Exception handlers</div>
                        <ul>
                            <code>Exception handlers are responsible for "enriching" exceptions and/or decoding vendor specific exceptions.</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">Metadata handlers</div>
                        <ul>
                            <code>Metadata handlers are responsible to read Database metadata while handling all vendor specific nuances.</code>
                        </ul>
                    </li>
                </ul>
            </section>

            <!-- Query runner
            ================================================== -->
            <section id="query-runner">
                <div class="page-header">
                    <h1>3.1 Query runner</h1>
                </div>
                <p class="lead">Query runner can be received via MjdbcFactory:
                <pre class="prettyprint linenums">
QueryRunnerService runner = MjdbcFactory.getQueryRunner(conn);</pre>

                <p class="lead">Query runner is core part of the system and is responsible for query execution:
                <pre class="prettyprint linenums">
// batch example
int[] rowsUpdated = runner.batch("INSERT INTO students (name) VALUES (?)", batchParameters);
// query example
Map&gtString, Object&lt result = runner.query(input, new MapOutputHandler());
// update example
runner.update(input, new RowCountOutputHandler&ltInteger&gt());
// call example
result = runner.call(input);</pre>
                <ul>
                    <li>
                        <div class="well well-small well-no-margin-c">batch</div>
                        <ul>
                            <code>batch allows executing few queries in one batch.</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">update</div>
                        <ul>
                            <code>update allows updating database tables/values (SQL INSERT, UPDATE, or DELETE queries).</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">query</div>
                        <ul>
                            <code>query allows querying database tables/values (SQL SELECT queries).</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">call</div>
                        <ul>
                            <code>call allows executing Stored Procedures/Functions (SQL CALL queries).</code>
                        </ul>
                    </li>
                </ul>

                <br/>

                <p class="lead">Also Query runner allows to perform Transaction management:</p>

                <p>By default <code>QueryRunnerService</code> is running in auto commit mode(every query execution is committed immediately). In order to perform Transaction management you need to set it into Manual mode:</p>
                <pre class="prettyprint linenums">
runner.setTransactionManualMode(true);
runner.setTransactionIsolationLevel(Connection.TRANSACTION_READ_COMMITTED);
...
runner.commit()/runner.rollback();</pre>
                <ul>
                    <li>
                        <div class="well well-small well-no-margin-c">runner.commit/rollback/rollback(savepoint)</div>
                        <ul>
                            <code>allows commit or rollback your current transaction</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">runner.setSavepoint()/setSavepoint(name)/releaseSavepoint(savepoint)</div>
                        <ul>
                            <code>allows to perform savepoint creation/releasing</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">runner.setTransactionIsolationLevel</div>
                        <ul>
                            <code>allows to set Transaction isolations level. For more details please visit: <a href="http://docs.oracle.com/javase/tutorial/jdbc/basics/transactions.html#transactions_data_integrity">JDBC Transactions</a></code>
                        </ul>
                    </li>
                </ul>

            </section>

            <!--
            ================================================== -->
            <section id="io-handlers">
                <div class="page-header">
                    <h1>3.2 Input/Output handlers</h1>
                </div>
                <p class="lead">Input handlers are responsible for handling input: such as (named) SQL query and input parameter values.</p>
                <br/>

                <p class="lead">Input handlers handles useful to get to know at the beginning:</p>
                <pre class="prettyprint linenums">
Map&ltString, Object&gt queryParameters = new HashMap&ltString, Object&gt();
queryParameters.put("id", 1);

MapInputHandler input = new MapInputHandler("SELECT name FROM students WHERE id = :id", queryParameters);
...
input = new BeanInputHandler&ltStudent&gt("{call TEST_NAMED(:id, :name, :address)}", student);
// result would be filled student object searched by ID = 2. All values would come from OUT parameters
Student result = runner.call(input);</pre>
                <ul>
                    <li>
                        <div class="well well-small well-no-margin-c">MapInputHandler</div>
                        <ul>
                            <code>allows using Java Map as source for parameter values</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">BeanInputHandler</div>
                        <ul>
                            <code>allows using Java Class as source for parameter values (only fields with getter/setter would be read)</code>
                        </ul>
                    </li>
                </ul>

                <br/>

                <p class="lead">Input handlers handles useful to get to know for more advanced queries:</p>
                <pre class="prettyprint linenums">
QueryParameters parameters = new QueryParameters();

// for Oracle
parameters.set("cursor", null, oracle.jdbc.OracleTypes.CURSOR, QueryParameters.Direction.OUT);
parameters.set("id", 2, Types.INTEGER, QueryParameters.Direction.IN);

input = new QueryInputHandler("{CALL :cursor := TEST_PROC_RETURN(:id)}", parameters);
runner.call(input, new MapOutputHandler());</pre>
                <ul>
                    <li>
                        <div class="well well-small well-no-margin-c">QueryInputHandler</div>
                        <ul>
                            <code>allows setting type/order/direction/value of parameters</code>
                        </ul>
                    </li>
                </ul>

                <hr class="bs-docs-separator">

                <p class="lead">Output handlers are responsible for handling/conversion query output (ResultSets).</p>
                <br/>

                <p class="lead">Output handlers handles useful to get to know at the beginning:</p>
                <pre class="prettyprint linenums">
Map&ltString, Object&gt studentMap = runner.query(input, new MapOutputHandler());
Stunent student = runner.query(input, new BeanOutputHandler&ltStudent&gt());
List&ltMap&ltString, Object&gt&gt studentMapList = runner.query(input, new MapListOutputHandler());
List&ltStunent&gt studentList  = runner.query(input, new BeanListOutputHandler&ltStudent&gt());</pre>
                <ul>
                    <li>
                        <div class="well well-small well-no-margin-c">MapOutputHandler</div>
                        <ul>
                            <code>allows receiving first row of query output as Map.</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">BeanOutputHandler</div>
                        <ul>
                            <code>allows receiving first row of query output as Java Class (only fields with getter/setter would be set)</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">MapListOutputHandler</div>
                        <ul>
                            <code>allows receiving query output as List of Maps.</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">BeanListOutputHandler</div>
                        <ul>
                            <code>allows receiving query output as List of Java Classes (only fields with getter/setter would be set)</code>
                        </ul>
                    </li>
                </ul>

                <br/>

                <p class="lead">Output handlers handles useful to get to know for more advanced queries:</p>
                <pre class="prettyprint linenums">
MapLazyOutputHandler lazyStudentMapCache = runner.query(input, new MapLazyOutputHandler());
BeanLazyOutputHandler lazyStudentCache = runner.query(input, new BeanLazyOutputHandler&ltStudent&gt());
MapLazyScrollOutputHandler lazyStudentScrollMapCache = runner.query(input, new MapLazyScrollOutputHandler());
BeanLazyScrollOutputHandler lazyStudentScrollCache = runner.query(input, new BeanLazyScrollOutputHandler&ltStudent&gt());</pre>
                <ul>
                    <li>
                        <div class="well well-small well-no-margin-c">MapLazyOutputHandler</div>
                        <ul>
                            <code>allows iterating over(forward only) query output as Map. Data is read only when requested.</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">BeanLazyOutputHandler</div>
                        <ul>
                            <code>allows iterating over(forward only) query output as Java Class. Data is read only when requested.</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">MapLazyScrollOutputHandler</div>
                        <ul>
                            <code>allows iterating over(in any direction) query output as Map. Data is read only when requested.</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">BeanLazyScrollOutputHandler</div>
                        <ul>
                            <code>allows iterating over(in any direction) query output as Map. Data is read only when requested.</code>
                        </ul>
                    </li>
                </ul>
            </section>

            <!-- Type handlers
            ================================================== -->
            <section id="type-handlers">
                <div class="page-header">
                    <h1>3.3 Type handlers</h1>
                </div>
                <p class="lead">Type handlers are responsible for handling types (for example: automatically converts byte[] into BLOB and back).</p>

                <p class="lead">By default type handling is not performed. If one required - you need to use it explicitly:</p>
                <pre class="prettyprint linenums">
// for whole system
MjdbcConfig.setDefaultTypeHandler(OracleTypeHandler.class/UniversalTypeHandler.class);
// for this particular QueryRunner
QueryRunnerService runner = MjdbcFactory.getQueryRunner(conn, OracleTypeHandler.class/UniversalTypeHandler.class);</pre>
                <pre class="prettyprint linenums">
QueryRunnerService runner = MjdbcFactory.getQueryRunner(conn, UniversalTypeHandler.class);
...
QueryParameters parameters = new QueryParameters();

// in this example we set String value into both SQL Clob and SQL Blob. Type handlers would perform required conversion.
parameters.set("clobIn", "John", MjdbcTypes.CLOB, QueryParameters.Direction.IN);
parameters.set("clobOut", null, MjdbcTypes.CLOB, QueryParameters.Direction.OUT);

parameters.set("blobIn", "Doe", MjdbcTypes.BLOB, QueryParameters.Direction.IN);
parameters.set("blobOut", null, MjdbcTypes.BLOB, QueryParameters.Direction.OUT);
                        
input = new QueryInputHandler(DBConstants.CALL_PROCEDURE_LARGE, parameters);
QueryParameters updatedParameters = runner.call(input, new MapOutputHandler()).getCallInput();

// we would receive String value
updatedParameters.getValue("clobOut");
// we would receive byte[] value
updatedParameters.getValue("blobOut");</pre>

                <p class="lead">Type handlers useful to get to know at the beginning:</p>
                <ul>
                    <li>
                        <div class="well well-small well-no-margin-c">EmptyTypeHandler</div>
                        <ul>
                            <code>should be used when no type handling is required</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">OracleTypeHandler</div>
                        <ul>
                            <code>should be used to perform type handling for Oracle Database</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">UniversalTypeHandler</div>
                        <ul>
                            <code>should be used to perform type handling for MySQL/MariaDB/PostgreSQL/MsSQL etc.</code>
                        </ul>
                    </li>
                </ul>

                <br/>

                <p class="lead">Type handlers useful to get to know for extention of the library:</p>
                <ul>
                    <li>
                        <div class="well well-small well-no-margin-c">BaseTypeHandler</div>
                        <ul>
                            <code>this class is base type handler implementation with support of JDBC4 only, serves as base for other type handlers</code>
                        </ul>
                    </li>
                </ul>
            </section>

            <!-- Other features
            ================================================== -->
            <section id="other-features">
                <div class="page-header">
                    <h1>3.4 Other features</h1>
                </div>

                <p class="lead">Features useful to get to know at the beginning:</p>
                <pre class="prettyprint linenums">
// switch it on. that's it. no more actions is required.
MjdbcConfig.setProfilerEnabled(true);

// if you need to modify profiling string - can be done via:
MjdbcConfig.setProfilerOutputFormat("Invoked class [%s].\n - Method [%s{}]\n - Args [%s]\n - Time [%5.3f] sec ");</pre>
                <ul>
                    <li>
                        <div class="well well-small well-no-margin-c">Profiling</div>
                        <ul>
                            <code>allows to perform query profiling</code>
                        </ul>
                    </li>
                </ul>

                <br/>

                <p class="lead">Features which might be useful during advanced library usage:</p>
                <pre class="prettyprint linenums">
// creation of pooled data source. All required dependencies should be added. <a href="mjdbc-other-features.html#pooled-datasource">Click for details</a>
DataSource ds = MjdbcFactory.createDataSource(driverClassName, url, userName, password, initialSize, maxActive);
// more advanced example
DataSource ds = MjdbcFactory.createDataSource(properties);

// Midao config allows configuration of Midao JDBC library:
MjdbcConfig.setProfilerOutputFormat("Invoked class [%s].\n - Method [%s{}]\n - Args [%s]\n - Time [%5.3f] sec ");
MjdbcConfig.setDefaultLazyCacheMaxSize(newCacheMaxSize);
// etc.
</pre>
                <ul>

                    <li>
                        <div class="well well-small well-no-margin-c">Pooled data sources</div>
                        <ul>
                            <code>provides connection pool using Apache DBCP or C3P0</code>
                        </ul>
                    </li>
                    <li>
                        <div class="well well-small well-no-margin-c">MjdbcConfig</div>
                        <ul>
                            <code>allows tweaking of Midao JDBC Library</code>
                        </ul>
                    </li>
                </ul>

            </section>

            <!-- Examples
            ================================================== -->
            <section id="examples">
                <div class="page-header">
                    <h1>4. Examples</h1>
                </div>
                <p class="lead">Below you will find few interesting examples to see above in action:</p>

                <p class="lead">A lot more examples can be found in <a href="https://github.com/pryzach/midao/tree/master/midao-jdbc-examples/src/main/java/org/midao/jdbc/examples">GitHub Examples</a></p>

            </section>

            <!-- Simple example
            ================================================== -->
            <section id="simple-example">
                <div class="page-header">
                    <h1>4.1 Simple examples</h1>
                </div>
<pre class="prettyprint linenums">
QueryRunnerService runner = MjdbcFactory.getQueryRunner(this.dataSource);

Map&ltString, Object&gt queryParameters = new HashMap&ltString, Object&gt();
queryParameters.put("id", 1);

MapInputHandler input = new MapInputHandler("SELECT name FROM students WHERE id = :id", queryParameters);

Map&ltString, Object&gt studentMap = runner.query(input, new MapOutputHandler());
// or
Student student = runner.query(input, new BeanOutputHandler&ltStudent&gt());</pre>

            </section>

            <!-- List example
            ================================================== -->
            <section id="list-example">
                <div class="page-header">
                    <h1>4.2 List examples</h1>
                </div>
<pre class="prettyprint linenums">
QueryRunnerService runner = MjdbcFactory.getQueryRunner(this.dataSource);

Map&ltString, Object&gt queryParameters = new HashMap&ltString, Object&gt();
queryParameters.put("id", 1);

MapInputHandler input = new MapInputHandler("SELECT name FROM students WHERE id > :id", queryParameters);

List&ltMap&ltString, Object&gt&gt studentMapList = runner.query(input, new MapListOutputHandler());
// or
List&ltStudent&gt studentList = runner.query(input, new BeanListOutputHandler&ltStudent&gt());</pre>

            </section>

            <!-- Lob types example
            ================================================== -->
            <section id="lob-example">
                <div class="page-header">
                    <h1>4.3 Lob types example</h1>
                </div>
                <pre class="prettyprint linenums">
QueryRunnerService runner = MjdbcFactory.getQueryRunner(conn, UniversalTypeHandler.class/OracleTypeHandler.class/BaseTypeHandler.class);
...
QueryParameters parameters = new QueryParameters();

// in this example we set String value into both SQL Clob and SQL Blob. Type handlers would perform required conversion.
parameters.set("clobIn", "John", MjdbcTypes.CLOB, QueryParameters.Direction.IN);
parameters.set("clobOut", null, MjdbcTypes.CLOB, QueryParameters.Direction.OUT);

parameters.set("blobIn", "Doe", MjdbcTypes.BLOB, QueryParameters.Direction.IN);
parameters.set("blobOut", null, MjdbcTypes.BLOB, QueryParameters.Direction.OUT);
                        
input = new QueryInputHandler("{call TEST_PROC_LARGE(:clobIn, :clobOut, :blobIn, :blobOut)}", parameters);

QueryParameters updatedParameters = runner.call(input, new MapOutputHandler()).getCallInput();

// we would receive String value
updatedParameters.getValue("clobOut");
// we would receive byte[] value
updatedParameters.getValue("blobOut");</pre>

            </section>

            <!-- Intense debate -->
            <section id="feedback">
                <div class="page-header">
                    <h1>Feedback</h1>
                </div>

                <p class="lead">Below you can provide feedback, suggestions, questions regarding information posted on current page</p>

                <script>
                    var idcomments_acct = '5ecab3490982db30c1c539bf485f65f2';
                    var idcomments_post_id;
                    var idcomments_post_url;
                </script>
                <span id="IDCommentsPostTitle" style="display:none"></span>
                <script type='text/javascript' src='http://www.intensedebate.com/js/genericCommentWrapperV2.js'></script>
            </section>

        </div>
    </div>

</div>

<!-- Footer
================================================== -->
<footer class="footer">
    <div class="container">
        <p>Designed and built based on Bootstrap</p>

        <p>Contact <a href="mailto:midao@midao.org">midao@midao.org</a> or <a target="_blank" href="http://twitter.com/midaoproject">@midaoproject</a></p>

        <ul class="footer-links">
            <li>
                <script src="http://platform.linkedin.com/in.js" type="text/javascript">
                    lang: en_US
                </script>
                <script type="IN/Share"></script>
            </li>
            <li class="muted">&middot;</li>
            <li>
                <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://midao.org/home.html" data-text="Check Midao Project" data-via="midaoproject" data-count="none">Tweet</a>
                <script>!function (d, s, id) {
                    var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
                    if (!d.getElementById(id)) {
                        js = d.createElement(s);
                        js.id = id;
                        js.src = p + '://platform.twitter.com/widgets.js';
                        fjs.parentNode.insertBefore(js, fjs);
                    }
                }(document, 'script', 'twitter-wjs');</script>
            </li>
        </ul>

        <ul class="footer-links">
            <li><a target="_blank" href="https://github.com/pryzach/midao">GitHub</a></li>
            <li class="muted">&middot;</li>
            <li><a target="_blank" href="https://github.com/pryzach/midao/issues">Issues / Questions / Feature request</a></li>
            <li class="muted">&middot;</li>
            <li><a target="_blank" href="https://github.com/pryzach/midao/blob/master/CHANGELOG.md">Change log</a></li>
        </ul>
    </div>
</footer>


<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<script src="js/jquery.js"></script>
<script src="js/bootstrap-transition.js"></script>
<script src="js/bootstrap-alert.js"></script>
<script src="js/bootstrap-modal.js"></script>
<script src="js/bootstrap-dropdown.js"></script>
<script src="js/bootstrap-scrollspy.js"></script>
<script src="js/bootstrap-tab.js"></script>
<script src="js/bootstrap-tooltip.js"></script>
<script src="js/bootstrap-popover.js"></script>
<script src="js/bootstrap-button.js"></script>
<script src="js/bootstrap-collapse.js"></script>
<script src="js/bootstrap-carousel.js"></script>
<script src="js/bootstrap-typeahead.js"></script>
<script src="js/bootstrap-affix.js"></script>

<script src="js/holder/holder.js"></script>
<script src="js/google-code-prettify/prettify.js"></script>

<script src="js/application.js"></script>

</body>
</html>
